from PyQt5.QtWidgets import QApplication, QWidget, QPushButton

class MyWindow(QWidget):
    def __init__(self):
        super().__init__()

        self.setWindowTitle('Hello PyQt')
        self.setGeometry(100, 100, 300, 200)

        button = QPushButton('Click me!', self)
        button.move(50, 50)

        button.clicked.connect(self.button_clicked)

    def button_clicked(self):
        print('Button was clicked!')

if __name__ == '__main__':
    app = QApplication([])
    window = MyWindow()
    window.show()
    app.exec_()